#!/usr/bin/env ruby

require 'logger'
require 'gserver'

class StatusMonitor < GServer
    def initialize(host = "127.0.0.1", port=7654)
        super(port, host)
        @level_map = {
            'w' => 'warn', 'e' => 'error', 'f' => 'fatal'
        }
        @logger = Logger.new(STDOUT)
    end
    
    def serve(client)
        print "started serving...\n"
        text = client.gets
        @logger.send('w', "#{app} -- #{msg}")
        client.puts('0')
    end
end

sm = StatusMonitor.new
sm.start
sm.join
